package com.intretech.umsin.auth.model;

import com.intretech.umsin.common.constant.UserConstants;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;

/**
 * @version V1.0
 * @ClassName: LoginBody
 * @Description: 功能描述 用户登录对象
 * @author: 李启联
 * @date: 2022-8-8 14:50
 * @Copyright: Copyright (c) 2022
 */

@ApiModel("用户登录对象")
public class LoginBody implements Serializable {

    /**
     * 用户账号
     */
    @NotBlank(message = "user account not blank")
    @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.USERNAME_MAX_LENGTH, message = "Account length must be between {min} and {max} characters")
    @ApiModelProperty(value = "用户账号")
    private String account;

    /**
     * 用户密码
     */
    @NotBlank(message = "user password not blank}")
    @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "Password length must be between {min} and {max} characters")
    @ApiModelProperty(value = "用户密码")
    private String password;


    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public LoginBody() {
    }

    public LoginBody(String account, String password) {
        this.account = account;
        this.password = password;
    }

    @Override
    public String toString() {
        return "LoginBody{" +
                "account='" + account + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}